package com.shoppingwebsite.dao;

import com.shoppingwebsite.domain.YtGoods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface GoodsDao {
    @Select("select *from yt_goods")
    public List<YtGoods> selectAll();

    @Select("select *from yt_goods where name like #{name}")
    public List<YtGoods> selectByName(String name);

    @Update("update yt_goods set xl=xl+1 where name=#{name}")
    public void buyGoods(String name);

    @Select("select *from yt_goods order by ${sort}")
    public List<YtGoods> search(@Param("sort") String sort);
}
